<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:m="http://www.mythe.com.br/facelets"
	  xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditUserTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
			<h:form prependId="false">
			<p:panel header="#{bundle.DadosGerais}">
				<h:panelGrid columns="2" width="500" columnClasses="campoRotulo, campoDado">
					<h:graphicImage url="/images/spacer.png" height="1" width="150" />
					<h:graphicImage url="/images/spacer.png" height="1" width="350" />
					
					<h:outputLabel value="#{bundle.UserLabelUsername}: "
						for="usernameUser" />
					<h:inputText id="usernameUser"
						value="#{userController.selected.username}"
						title="#{bundle.UserLabelUsername}" size="50"/>	
					
					<h:outputLabel value="#{bundle.UserLabelName}: "
						for="nameUser" />
					<h:inputText id="nameUser"
						value="#{userController.selected.name}"
						title="#{bundle.UserLabelName}" size="50"/>				

					<h:outputLabel value="#{bundle.UserLabelPassword}: "
						for="passwordUser" />
					<p:password feedback="Seis caracteres" minLength="6" 
					    id="passwordUser"
						value="#{userController.selected.password}"
						title="#{bundle.UserLabelName}" size="50"/>				

					<h:outputLabel value="#{bundle.UserLabelEmail}: "
						for="emailUser" />
					<h:inputText id="emailUser"
						value="#{userController.selected.email}"
						title="#{bundle.UserLabelEmail}" size="50"/>				

					<h:outputLabel value="#{bundle.UserLabelOrganization}: "
						for="organizationUser" />
					<h:selectOneMenu id="organizationUser"
						value="#{userController.selected.organization}">
						<f:selectItems value="#{organizationController.itemsAvailableSelectOne}" />
					</h:selectOneMenu>

					<h:outputLabel value="#{bundle.UserLabelGroup}: "
						for="groupUser" />
					<h:selectOneMenu id="groupUser"
						value="#{userController.selected.group}">
						<f:selectItems value="#{groupController.itemsAvailableSelectOne}" />
					</h:selectOneMenu>

					<h:outputLabel value="#{bundle.UserLabelState}: "
						for="stateUser" />
					<h:selectOneMenu id="stateUser"
						value="#{userController.selected.status}">
						<f:selectItems value="#{userController.userStates}" />						
					</h:selectOneMenu>


				</h:panelGrid>
			</p:panel>
			<br />
                <ul>
	                <li>
	                	<h:commandButton styleClass="ui-state-default" action="#{userController.update}" value="#{bundle.GeralLinkSalvar}"/>
	                </li>
                </ul>
            </h:form>
        </ui:define>
                <ui:define name="menuAcoes">
			<h:form>
			<ul class="menu-acoesAbas">
                <li>
                	<h:commandButton styleClass="ui-state-default" action="View" value="#{bundle.GeralLinkExibir}" immediate="true"/>
                </li>
                <li>
                	<h:commandButton styleClass="ui-state-default" action="#{userController.prepareList}" value="#{bundle.GeralLinkListar}" immediate="true"/>
                </li>
                <li>
                	<h:commandButton styleClass="ui-state-default" value="#{bundle.GeralLinkIndex}" action="/index" immediate="true" />			    
			    </li>
			</ul>
			</h:form>
		</ui:define>
        
    </ui:composition>

</html>
